/*
 * @Author: your name
 * @Date: 2021-05-13 11:17:31
 * @LastEditTime: 2021-05-14 15:12:12
 * @LastEditors: your name
 * @Description: In User Settings Edit
 * @FilePath: \erabbit\src\store\index.js
 */

// createStore创建一个store实例
import { createStore, createLogger } from 'vuex'
import createPersistedstate from 'vuex-persistedstate'
import user from './modules/user'
import cart from './modules/cart'
import category from './modules/category'
export default createStore({
  state: {
  },
  mutations: {
  },
  actions: {
  },
  modules: {
    user,
    cart,
    category
  },
  plugins: [// vuex本身支持的配置项
    createPersistedstate({ // 固定语法
      key: 'erabbit-client-pc-store', // 代表要存储的
      paths: ['user', 'cart']// 要把哪些数据进行持久化保存
    }),
    createLogger()
  ]

})
